//
//  Constant.swift
//  BaseProj
//
//  Created by 陈宇 on 2017/4/26.
//  Copyright © 2017年 科匠武汉. All rights reserved.
//

import SwiftyBeaver
import Moya

func debug() -> Bool {
    #if DEBUG
        return true
    #else
        return false
    #endif
}

struct Constant {
    static let UI_NAVIGATION_BAR_HEIGHT = 44
    static let UI_TAB_BAR_HEIGHT = 49
    static let UI_STATUS_BAR_HEIGHT = 20
    static let UI_SCREEN_WIDTH = UIScreen.main.bounds.width
    static let UI_SCREEN_HEIGHT = UIScreen.main.bounds.height
    static let CUSTOM_DATE_FORMAT_STRING = "yyyy-MM-dd"
}

struct APP {
    static let API_HOST = "http://10.58.177.66:8080"
    static let VIEW_BG_COLOR = UIColor(hex: 0xf6f6f6)
    static let APP_PRIMARY_COLOR = UIColor(hexString: "#e85454")
    static let APP_PLACEHOLDER_URL = URL(string: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1494233971018&di=fb408a58707aa43069caecb91e5781d3&imgtype=0&src=http%3A%2F%2Fwww.ccgoufang.com%2Fupload%2Fresources%2Fimage%2F2016%2F01%2F27%2F30489.jpg")!
}

struct Other {
    static let RCIMKey = ""
}

// MARK: - 日志相关
func configureLog() {
    if debug() {
        let console = ConsoleDestination()
        console.format = "$C$c- $M"
        log.addDestination(console)
    }
}

let log = SwiftyBeaver.self
let api = RxMoyaProvider<RestFullAPI>(plugins: [TokenPlugin(), NetworkSpinnerPlugin(), NetworkLoggerPlugin(verbose: true, cURL: true)])
